//-----------------------------------------------------------------
// Licensed Materials - Property of IBM
//
// WebSphere Commerce
//
// (C) Copyright IBM Corp. 2011 All Rights Reserved.
//
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedule Contract with
// IBM Corp.
//-----------------------------------------------------------------

// JavaScript Document
 
//<![CDATA[

var tips; var theTop = 145; 
var old = theTop;

function initFloatTips(floatDiv) {

	tips = document.getElementById(floatDiv);
	//alert("d");
	moveTips();

};

function moveTips() {

	var tt=50;
	
	if (window.innerHeight) {
	
		pos = window.pageYOffset
	
	} else if (document.documentElement && document.documentElement.scrollTop) {

		pos = document.documentElement.scrollTop
	
	} else if (document.body) {

		pos = document.body.scrollTop;
	
	}

	pos=pos-tips.offsetTop+theTop;
	
	pos=tips.offsetTop+pos/10;



	if (pos < theTop) pos = theTop;
	//alert(pos);
	if (pos != old) {
		//alert(pos);
		tips.style.top = pos+"px";
		
		tt=10;
		
		//alert(tips.style.top);
	
	}

	;

	old = pos;
	
	setTimeout(moveTips,tt);

}

//!]]>
 

function OnlineOver(floatDiv){

	//document.getElementById("divMenu").style.display = "none";
	
	//document.getElementById("divOnline").style.display = "block";
	$("#divOnline").show(500);
	$("#divMenu").hide(500);
	document.getElementById(floatDiv).style.width = "145px";

}




function OnlineOut(){

	//document.getElementById("divMenu").style.display = "block";
	//document.getElementById("divOnline").style.display = "none";
	
	$("#divMenu").show(500);
	$("#divOnline").hide(500);

}


if(typeof(HTMLElement)!="undefined")    
{   
      HTMLElement.prototype.contains=function(obj)   
      {   
          while(obj!=null&&typeof(obj.tagName)!="undefind"){ 
        	  if(obj==this) return true;   
        	  obj=obj.parentNode;
          }   
          return false;   
      };   
}  


function hideMsgBox(theEvent){  

	if (theEvent){

		var browser=navigator.userAgent;  
	
		if (browser.indexOf("Firefox")>0){  
	
			if (document.getElementById('divOnline').contains(theEvent.relatedTarget)) { 
		
				return; 
		
			} 
	
		} 
	
		if (browser.indexOf("MSIE")>0){  
		
			if (document.getElementById('divOnline').contains(event.toElement)) { 
			
				return; 
			
			}
		
		}

	}

 
	//document.getElementById("divMenu").style.display = "block";
	//document.getElementById("divOnline").style.display = "none";
	$("#divMenu").show(500);
	$("#divOnline").hide(500);

}

function goTop() {
	document.body.scrollTop=0;
}
